<template>
    <view class="con">
      <view class="icon">
        <my-status></my-status>
        <my-icon></my-icon>
      </view>
      <swiper v-bind:style="{ height: winHeight}" :current="firstSwiperCurrent" @change="changeeCurrent">
        <swiper-item>
          <my-goods></my-goods>
        </swiper-item>
        <swiper-item>
          <my-goodlist @changeCurrent="getCurrent"></my-goodlist>
        </swiper-item>
      </swiper>
      <view class="con-pop" v-if="hidden">
        <view class="pop-up">
          <image src="../../static/tab-bar/小于.png"></image>
          <text v-if="chOrEn">
             左滑查看蛋糕分类
          </text>
		  <view v-else class="sort">
			<text>S</text>
			<text>L</text>
			<text>T</text> 
			<text>V</text>
			<text>C</text>
		  </view>
        </view>
      </view>
      <pop></pop>
	</view>
</template>

<script>
	import style from "@/store/style.js"
	export default {
		data(){
			return{
				winHeight: '',
				hidden: true,
				firstSwiperCurrent: 0,
				chOrEn: style.state.flag
			};
		},
		methods:{
			getCurrent(childNum){
				this.firstSwiperCurrent = childNum
			},
			changeeCurrent(e){
				this.firstSwiperCurrent = e.detail.current
			}
			
		},
		onLoad(){
			let winHeight = wx.getSystemInfoSync().windowHeight
			this.winHeight = winHeight + 'px'
		},
		mounted(){
			setTimeout(() => {
				this.hidden = false
			}, 4000)
		}
	}
	
</script>

<style lang="scss" scoped>
  .con{
    .con-pop{
    	display: flex;
    	align-items: center;
    	height: 100%;
    	width: 70px;
    	position: fixed;
    	z-index: 2;
    	right: 0;
    	top: 0;
    	.pop-up{
    		display: flex;
    		justify-content: center;
    		align-items: center;
    		flex-direction: column;
    		height: 240px;
    		width: 100%;
    		background: linear-gradient(to right, rgba(255,255,255,0), #000000);
    		opacity: 0.8;
    		text{
    			width: 19px;
    			height: 200px;
    			color: white;
    			font-weight: lighter;
    			padding: 5px;
    		}
    		image{
    			width: 16px;
    			height: 17px;
    			margin-top: 20px;
    		}
    	}	
    }
  }
  .sort{
	  display: flex;
	  flex-direction: column;
	  height: 200px;
	  text{
		font-size: 20px;
		height: 20px;
		width: 50px;
	  }
  }

</style>